
<link href="internas/estilo.css" rel="stylesheet" type="text/css" />
<!--<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.min.js"></script>-->
<script type="text/javascript" src="internas/agenda.js"></script>
<script type="text/javascript">
	function span(id){
		display = document.getElementById('span'+id).style.display;
		if(display == 'none'){		
			$("#span"+id).slideDown(1000);
			document.getElementById('flecha'+id).src = "img/imagens/flecha_mais4.png";
		}else{
			//document.getElementById('span'+id).style.display='none';
			$("#span"+id).slideUp(1000);
			document.getElementById('flecha'+id).src = "img/imagens/flecha_mais.png";
		}
	}
</script>
<style type="text/css">
#voltar {
	background-image:url(img/imagens/voltar3.png);
}
</style>
<?php
$dia = $_GET['dia'];
$mes = $_GET['mes'];

$ano = $_GET['ano'];
$primeiroDia = date("D", mktime(0, 0, 0, $mes, $dia, $ano));
	switch($primeiroDia){
		case "Sun":
			$pos = 'Domingo';
		break;
	
		case "Mon":
			$pos = 'Segunda';
		break;
	
		case "Tue":
			$pos = 'Ter&ccedil;a';
		break;
	
		case "Wed":
			$pos = 'Quarta';
		break;
	
		case "Thu":
			$pos = 'Quinta';
		break;
	
		case "Fri":
			$pos = 'Sexta';
		break;
	
		case "Sat":
			$pos = 'Sabado';
		break;
}
$mes_array = array("01" => "janeiro","02" => "Fevereiro","03" => "Mar&ccedil;o","04" => "Abril","05" => "Maio","06" => "Junho","07" => "Julho","08" => "Agosto","09" => "Setembro","10" => "Outubro","11" => "Novembro","12" => "Dezembro");
?>
<div style="top:15px;;position:relative;background-image:url(img/top_menu2.png);width:660px;height:45px;">
    <div style="width:400px;position:relative;top:6px;left:20px;">
    <font style="font-family:'Trebuchet MS', Arial, Helvetica, sans-serif;font-size:20px;color:white;" >Agenda - <?php echo $dia.'/'.$mes.'/'.$ano; ?></font>
    </div>
</div>
<div style="height:10px;"></div>
<?php include 'internas/redesocial.php'; ?>
<div class="vid2" style="left:30px;top:20px;font-family:'Trebuchet MS', Arial, Helvetica, sans-serif;" >
<?php echo $pos.', '.$dia.' de '.$mes_array[$mes];?>
<br />
<div style="width:10px;float:right;position:relative;right:100px;top:-20px;">
<a style="text-decoration:none;font-family:'Trebuchet MS', Arial, Helvetica, sans-serif;" href="index.php">
<div style="width:81px;height:20px;" id="voltar"></div>
</a>
</div>
<?php
$sql_agenda = mysql_query("SELECT codigo,data,hora,evento,descricao FROM agenda WHERE date_format(data, '%Y-%m-%d' ) = '$ano-$mes-$dia'");
$cont = 0;
while(list($codigo,$data,$hora,$evento,$descricao)=mysql_fetch_array($sql_agenda)){
?>	
<div style="border:1px solid #FFF;width:600px;position:relative;">
<div style="background-color:#09C;">
<font color="#FFFFFF"><?php echo $hora.'- Evento:';?>
<?php echo $evento; ?>
</font>
<div style="right:0px;;position:relative;float:right;width:18px;height:18px;cursor:pointer;color:#FFF" onclick="span('<?php echo $cont ?>');"><img id="flecha<?php echo $cont ?>" src="img/imagens/flecha_mais.png" />
</div>
</div>
<span id="span<?php echo $cont;?>" style="display:none;border:1px solid #666;"><?php echo nl2br($descricao) ?></span>
</div>
<?php 
	$cont++;
}?>
</div>
